import type { AxiosResponse, AxiosRequestConfig, InternalAxiosRequestConfig } from 'axios'

export interface IInterceptors<T = AxiosResponse> {
  requestSuccessFn?: (config: InternalAxiosRequestConfig<T>) => InternalAxiosRequestConfig<T>
  requestFailureFn?: (error: any) => any
  responseSuccessFn?: (config: T) => T
  responseFailureFn?: (error: any) => any
}

export interface IRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  baseURL?: string
  timeout?: number
  interceptors?: IInterceptors<T>
}
